package com.yanmaohu.yulia.statement;

import com.yanmaohu.yulia.bean.AlterTableAction;
import com.yanmaohu.yulia.bean.LocalOrSchemaQualifiedName;

/**
 * @author Bright Lee
 */
public final class AlterTableStatement implements SqlSchemaManipulationStatement, Statement {

    private int beginIndex;
    private int endIndex;
    private final LocalOrSchemaQualifiedName tableName;
    private final AlterTableAction alterTableAction;

    public AlterTableStatement(int beginIndex, LocalOrSchemaQualifiedName tableName, AlterTableAction alterTableAction) {
        this.beginIndex = beginIndex;
        this.endIndex = alterTableAction.getEndIndex();
        this.tableName = tableName;
        this.alterTableAction = alterTableAction;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public LocalOrSchemaQualifiedName getTableName() {
        return tableName;
    }

    public AlterTableAction getAlterTableAction() {
        return alterTableAction;
    }

}
